using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SkeletonHitState : EnemyState
{
    Enemy_Skeleton enemy;
    public SkeletonHitState(Enemy enemyBase, EnemyStateMachine enemyStateMachine, string animatorName, Enemy_Skeleton enemy) : base(enemyBase, enemyStateMachine, animatorName)
    {
        this.enemy = enemy;
    }

    public override void Enter()
    {
        base.Enter();
        stateTimer =  enemy.knockBackTime;
        rb.velocity=new Vector2(enemy.knockDir * enemy.knockBackPower.x, enemy.knockBackPower.y);
    }

    public override void Exit()
    {
        base.Exit();
    }

    public override void Update()
    {
        base.Update();
        if (stateTimer < 0)
            enemyStateMachine.ChangeState(enemy.skeletonIdleState);
    }
     
}
